package com.zlkj.pro.modular.app.controller;

import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
import com.zlkj.pro.modular.business.service.TaskService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import static com.zlkj.pro.core.consts.ProjectConstants.SERVICE_APP_PREFIX;

/**
 * @author liyang
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@ApiResource(name = "test", path = SERVICE_APP_PREFIX + "/test")
public class TestController {

    @Autowired
    private TaskService taskService;

    @GetResource(name = "测试延期提醒", path = "/sendTodayNotice")
    public String sendTodayNotice() {
        return taskService.sendTodayNotice();
    }

    @GetResource(name = "重置当前所有代理商的书名号编码", path = "/resetCerNumber")
    public String resetCerNumber() {
        taskService.resetCerNumber();
        return "重置当前所有代理商的书名号编码成功！";
    }

}
